#include <stdio.h>
#include <string.h>


int n,p;
struct problemtype
{
	int simple;
	int hard;
}pp[110];

int shu[110];
int out[110];

int main()
{
	int i,j,min,max,k;
	
	memset(pp,0,sizeof(pp));

	scanf("%d%d", &n, &p);
	for (k=1;k<=n;k++)
	{
		min=50000;
		max=-1;
		for (i=1;i<=p;i++)
		{
			scanf("%d", &shu[i]);
			if (min>shu[i]) min=shu[i];
			if (max<shu[i]) max=shu[i];
		}
		for (i=1;i<=p;i++)
		{
			if (shu[i]==min) pp[i].simple++;
			if (shu[i]==max) pp[i].hard++;
		}
	}
	int half;
	half=n/2;
	memset(out,0,sizeof(out));
	for (i=1;i<=p;i++)
		if (pp[i].simple>half && pp[i].hard==0)
			out[++out[0]]=i;

	if (out[0]==0) printf("0\n");
	else
	{
		for (i=1;i<out[0];i++)
			printf("%d ", out[i]);
		printf("%d\n", out[i]);
	}




	return 0;
}